/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.services.finance;

/**
 *
 * @author jay
 */

import java.util.List;
import java.util.Map;
import javax.faces.model.SelectItem;
import src.domain.finance.Bank;
import src.services.CRUEDService;

public class BankModel implements java.io.Serializable {
    
    private CRUEDService service;
    
    public BankModel() {
        service = new CRUEDService();
    }
    
    public Bank getById(Integer id) {
        return (Bank)  service.getById(Bank.class, id);
    }
    
    public List<Bank> findAll(Map<String, String> filters) {
        return (List<Bank>) service.findAll("Bank", filters);
    }

    public List<SelectItem> listAll() {
        return service.listAll("Bank", "bankId", "bankName");
    }
    
    public boolean saveData(Bank data) {
        return service.saveData(data);
    }
    
    public boolean deleteData(Bank data) {
        return service.deleteData(data);
    }
}
